package com.financing.wap.service.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.financing.wap.dao.IBankInfoDao;
import com.financing.wap.dto.BankInfoDTO;
import com.financing.wap.service.IBankInfoService;

@Service("bankInfoServiceImpl")
public class BankInfoServiceImpl implements IBankInfoService{

	@Autowired
	private IBankInfoDao bankInfoDaoImpl;

	@Override
	public List<BankInfoDTO> queryBankInfoList(BankInfoDTO bankInfoDTO)
			throws SQLException {
		return bankInfoDaoImpl.queryBankInfoList(bankInfoDTO);
	}

	@Override
	public BankInfoDTO loadByParentcodeAndPayplat(String pay3platBaofoo,
			String bankcode) throws SQLException {
		BankInfoDTO bankInfoDTO = new BankInfoDTO();
		bankInfoDTO.setPayPlat(pay3platBaofoo);
		bankInfoDTO.setBankCode(bankcode);
		bankInfoDTO.setValidFlag("1");
		List<BankInfoDTO> bankList = bankInfoDaoImpl.queryBankInfoList(bankInfoDTO);
		if(bankList!=null && bankList.size()>0){
			return bankList.get(0);//银行信息
		}
		return null;
	}



}
